/*
   This example code is in the Public Domain (or CC0 licensed, at your option.)

   Unless required by applicable law or agreed to in writing, this
   software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
   CONDITIONS OF ANY KIND, either express or implied.
*/

#ifndef _USER_EVENT_H_
#define _USER_EVENT_H_

#include "esp_system.h"

#ifdef __cplusplus
extern "C" {
#endif

// 数据类型声明
typedef enum {
    USER_EVENT_KEY = 0,     
    USER_EVENT_WIFI,
    USER_EVENT_TFTP_DISK,     
    USER_EVENT_MAX
} user_event_id_t;

typedef struct {
    uint8_t key_val;
}user_event_key_t;

typedef struct {
    uint8_t wifi_status;
}user_event_wifi_t;

typedef struct {
    uint8_t tftp_disk_status;
}user_event_tftp_disk_t;

typedef union {
    user_event_key_t        key;
    user_event_wifi_t       wifi;
    user_event_tftp_disk_t  tftp_disk;
} user_event_info_t;

typedef struct {
    user_event_id_t         event_id;      
    user_event_info_t       event_info;
} user_event_t;

// 变量声明
extern QueueHandle_t user_event_queue;

#ifdef __cplusplus
}
#endif

#endif

